﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<VietImage.ViewModels.HomeViewModel>" %>
<%@ Register Src="~/Views/Home/Slider.ascx" TagName="slider" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Trang chủ 
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div style="height:450px; min-height:450px;">
    
            <div style="min-width:100px; width:auto; font-size:14px; text-align:right; vertical-align:top; float:left; margin-left:10px; margin-top:5px;">
<% 
    int lang = 2;
    slideshow.ViewData["DailyImages"] = Model.DailyImages;
    slideshow.ViewData["Language"] = 2;
    foreach (VietImage.Models.Category cat in Model.ParentCategories.Take(8))
   {
       if (cat.GetDetail(lang).Name == "")
       {
           String name = "No title";
       %>                <p style="text-transform: capitalize;"><%= Html.ActionLink(name, "Index", "Category", new { id = cat.ID }, null)%></p>
<%
}
       else
       {
           %>
           <p style="text-transform: capitalize;"><%= Html.ActionLink(cat.GetDetail(lang).Name, "Index", "Category", new { id = cat.ID }, null)%></p>
           <%
       }
   } %>
            </div>
            
            <div style="height:100%; width:13px; float:left; margin-left:5px;  margin-top:10px;">
                <div class="patternshade"></div>
                <div class="gradientshade"></div>
            </div>
            
            <div style="height:100%; text-align:center; vertical-align:middle; width:225px; float:left; margin-left:5px; margin-top:5px;">
                <table cellspacing="1" border="0">

<%  List<VietImage.Models.Category> lstSubCat = Model.WeeklySubCategories;
    for (int i = 0; i < lstSubCat.Count; i++)
    {
        if (i % 2 == 0)
        {
    %>
        <tr>
    <%
        }
        if (lstSubCat[i].PrimaryImage != null)
        {
        %>                    
                        <td class="framepicture"><a href="/Category/Detail/<%=lstSubCat[i].ID %>"><img src="/Image/Category/<%=lstSubCat[i].ID%>" alt="<%=lstSubCat[i].GetDetail(lang).Name %>" title="<%=lstSubCat[i].GetDetail(lang).Name %>"/></a></td>
        <%
}
        else
        {
            %>
                        <td class="framepicture"><a href="/Category/Detail/<%=lstSubCat[i].ID %>"><img src="/Image/Display/0" alt="<%=lstSubCat[i].GetDetail(lang).Name %>" title="<%=lstSubCat[i].GetDetail(lang).Name %>"/></a></td>

            <%
        }
                if (i % 2 != 0)
                {
            
        %>
        </tr>
<%              }
                    
    }
    %>
            
                </table>
            </div>

            <div style="height:100%; width:13px; float:left; margin-left:5px; margin-top:10px;">
                <div class="patternshade"></div>
                <div class="gradientshade"></div>
            </div>
            
            <div style="height:100%; float:left; margin-left:5px; margin-top:5px;">
                <uc:slider ID="slideshow" runat="server" />
                <!--
                <div class="slideShowBox">
                    <div id="theme-default"><div id="slider" class="nivoSlider">

                    <%
                        if (Model.DailyImages.Count > 0)
                        {
                            foreach (VietImage.Models.Image img in Model.DailyImages)
                            {
                                
                    %>
                        <img id="Img<%= img.ID %>" src="/Image/Display/<%= img.ID %>" alt="<%=img.GetDetail(lang).Name %>" title="<%=img.GetDetail(lang).Name %>" />
                    <%
                        }
                        }
                        else
                        {
                        
                    %>
                    <img id="ExImg" src="/Content/Images/Img-Slider/big_noimage.png" alt="" title="" />
                    <img id="Img1" src="/Content/Images/Img-Slider/big_noimage.png" alt="" title="" />
                    <img id="Img2" src="/Content/Images/Img-Slider/big_noimage.png" alt="" title="" />
                    <img id="Img3" src="/Content/Images/Img-Slider/big_noimage.png" alt="" title="" />
                    <%} %>
                    </div>
                    
                    <script src="/Scripts/jquery.nivo.slider.pack.js" type="text/javascript"></script>
                    <script type="text/javascript">
                        $(window).load(function () {
                            $('#slider').nivoSlider();
                        });

                    </script>

                    </div>
                </div> 

                <!-- Tooltip for sliderS
                    <div id="dtSlideExImg1" style="display:none; clear:both; position:absolute; margin-top:-450px; margin-left:30px;">
                        <table cellpadding="0" cellspacing="0" border="0">
                            <tr style="height:15px;">
                                <td class="left-top-border-panel-submenu"></td>
                                <td class="top-border-panel-submenu"></td>
                                <td class="right-top-border-panel-submenu"></td>
                            </tr>
                            <tr>
                                <td class="left-border-panel-submenu"></td>
                                <td class="center-panel-submenu">                                
                                    <div style="padding-left:10px; padding-top:10px;">
                                        <span style="font-size:16px">TÊN ẢNH</span><br /><br />
                                        <span style="font-style:italic;">Tên tác giả</span><br />
                                        <span style="font-style:italic">Ngày đăng</span><br />
                                        <div style="margin-bottom:20px; width:250px;">Mô tả : fdsfsd dsdfsdfsdfsdfs dfsdfsdfsdfsdfsdfs dfsdfsdfsdfd sfdfdf
                                        </div>
                                    </div>
                                </td>
                                <td class="right-border-panel-submenu"></td>
                            </tr>
                            <tr style="height:15px;">
                                <td class="left-bottom-border-panel-submenu"></td>
                                <td class="bottom-border-panel-submenu"></td>
                                <td class="right-bottom-border-panel-submenu"></td>
                            </tr>
                        </table>
                    </div>
                    -->
        
            </div>

    </div>
    <br /><br /><br /><br />
    <div id="search" style="text-align:right; clear:both; float:left; margin-left:600px; min-height:60px; height:60px;">
    <form id="simplesearch" name ="simplesearch" method="post" action="<%= Url.Action("Index","Search") %>">
        <table border="0" cellspacing="5" cellpadding="5">
            <tr>
                <td>
                    <table cellpadding="0" cellspacing="0" border="0">
	                    <tr class="tr-textbox">    
    	                    <td class="left-textbox"></td>
                            <td class="center-textbox">
                            <input value="Từ khóa ..." onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtSearch" type="text" class="search-textbox"/>
                            <input type="submit" style="display: none;" value="" />
                            </td>
    	                    <td class="right-textbox"></td>    
                        </tr>
                    </table>
                </td>
                <td>
                    <div class="button" style="cursor:pointer;" onmouseout="buttonmouseout('Search');" onmousedown="buttonmousedown('Search');" onmouseover="buttonmouseover('Search');"><table cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td id="lbtnSearch" class="left-button"></td>
                            <td id="mbtnSearch" class="middle-button"><span style="color:White;">TÌM KIẾM</span></td>
                            <td id="rbtnSearch" class="right-button"></td>                        
                        </tr>          
                    </table></div>                    
                </td>
                <td class="horizontalborder-twoline"></td>
                <td style="font-size:14px"><div id="lbAdSearch" style="cursor:pointer"><i>Tìm kiếm nâng cao</i></div></td>
            </tr>
        </table>
        </form>
    </div>

    <div id="searchPanel" style="display:none; clear:both; margin-left:100px; width:900px;">
            <table cellpadding="0" cellspacing="0" width="100%" style="min-width:800px;">
                <tr style="height:15px;">
                    <td class="left-top-border-panel-searchoption"></td>
                    <td class="top-border-panel-searchoption"></td>
                    <td class="right-top-border-panel-searchoption"></td>
                </tr>
                <tr>
                    <td class="left-border-panel-searchoption"></td>
                    <td class="center-panel-searchoption">
                    
                      <form id="advancedsearch" name="advancedsearch" method="post" action="<%= Url.Action("Advanced","Search") %>">
                        <input type="hidden" id="sImgName" name="sImgName" value="false" />
                        <input type="hidden" id="sCreatedTime" name="sCreatedTime" value="false" />
                        <input type="hidden" id="sAuthor" name="sAuthor" value="false" />
                        <input type="hidden" id="sCategory" name="sCategory" value="false" />
                        <input type="hidden" id="sCountry" name="sCountry" value="false" />
                        <input type="hidden" id="sCity" name="sCity" value="false" />
                        <div style="float:left; width:75%;">
                            <div style="vertical-align:middle;">
                                <div style="float:left; min-width:50%">
                                    <div style="padding:10px;">
                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbImgName"></div><div class="checked" id="cdImgName" style="margin-top:-16px; display:none;"></div></td>
                                                <td style="width:70px;">Tên ảnh</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="Từ khóa ..." onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtImgName" type="text" class="textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                    <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbCreatedTime"></div><div class="checked" id="cdCreatedTime" style="margin-top:-16px; display:none;"></div></td>
                                                <td style="width:70px;">Ngày đăng</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="Từ khóa ..." onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtCreatedTime" type="text" class="search-textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                    <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbAuthor"></div><div class="checked" id="cdAuthor" style="margin-top:-16px; display:none;"></div></td>
                                                <td style="width:70px;">Tên tác giả</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="Từ khóa ..." onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtAuthor" type="text" class="textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                </div>
                                <div style="float:left;">
                                     <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbCategory"></div><div class="checked" id="cdCategory" style="margin-top:-16px; display:none;"></div></td>
                                                <td style="width:90px;">Tên chùm ảnh</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="Từ khóa ..." onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtCategory" type="text" class="textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                    <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbCountry"></div><div class="checked" id="cdCountry" style="margin-top:-16px; display:none;"></div></td>
                                                <td style="width:90px;">Quốc gia</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="Từ khóa ..." onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtCountry" type="text" class="search-textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                    <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbCity"></div><div class="checked" id="cdCity" style="margin-top:-16px; display:none;"></div></td>
                                                <td style="width:90px;">Thành phố</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="Từ khóa ..." onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtCity" type="text" class="search-textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                </div>                                                 
                            </div>

                            <div style="max-width:50%; width:50%; float:left;">&nbsp;</div>
                                <div class="button" style="cursor:pointer; float:left;"  onmouseout="buttonmouseout('AdSearch');" onmousedown="buttonmousedown('AdSearch');" onmouseover="buttonmouseover('AdSearch');"><table cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                        <td id="lbtnAdSearch" class="left-button"></td>
                                        <td id="mbtnAdSearch" class="middle-button"><span style="color:White;">TÌM KIẾM</span></td>
                                        <td id="rbtnAdSearch" class="right-button"></td>                        
                                    </tr>          
                                </table>
                            </div>
                            <div style="float:left;">&nbsp;</div>
                                <div id="AdExit" style="cursor:pointer; float:left;"  onmouseout="buttonmouseout('AdExit');" onmousedown="buttonmousedown('AdExit');" onmouseover="buttonmouseover('AdExit');"><table cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                        <td id="lbtnAdExit" class="left-button"></td>
                                        <td id="mbtnAdExit" class="middle-button"><span style="color:White;">THOÁT</span></td>
                                        <td id="rbtnAdExit" class="right-button"></td>                        
                                    </tr>          
                                </table>
                            </div>

                        </div>
                    </form>

                        <div class="horizontalborder-fourline" style="height:200px; float:left; margin-bottom:-10px; margin-top:-14px;">
                        </div>

                        <div style="float:left; margin-left:20px;">
                            <div style="font-size:14px; float:left;">CÁC CHỦ ĐỀ</div>
                            <div class="right-arrow" style="margin-right:0px;"></div>
                            <br /><br />
                            <div style="margin-left:30px; font-style:italic;">
                                <a>Công nghệ thông tin</a><br />
                                <a>Phóng sự ảnh</a><br />
                                <a>Thể thao</a><br />
                                <a>Du lịch</a><br />
                                <a>Giao thông vận tải</a><br />
                                <a>Báo chí</a><br />
                                <a>Kinh tế</a><br />
                                <br />
                            </div>
                            <div style="float:right; font-style:italic;"><a>Chi tiết ..</a></div>
                        </div>
                    
                    </td>
                    <td class="right-border-panel-searchoption"></td>
                </tr>
                <tr style="height:15px;">
                    <td class="left-bottom-border-panel-searchoption"></td>
                    <td class="bottom-border-panel-searchoption"></td>
                    <td class="right-bottom-border-panel-searchoption"></td>
                </tr>
            </table>
    </div>

    
    <script type="text/javascript" language="javascript">

        $(window).load(function () {
            $("#lbAdSearch").click(function () {
                $("#searchPanel").slideDown("slow");
                $("#search").hide();
            });
            $("#AdExit").click(function () {
                $("#searchPanel").slideUp("slow");
                $("#search").show("slow");
            });

            $("#cbImgName").click(function () {
                if ($("#cdImgName").is(":hidden")) {
                    $("#cdImgName").fadeIn("normal");
                }
            });
            $("#cdImgName").click(function () {
                $("#cdImgName").hide();
            });

            $("#cbCreatedTime").click(function () {
                if ($("#cdCreatedTime").is(":hidden")) {
                    $("#cdCreatedTime").fadeIn("normal");
                }
            });
            $("#cdCreatedTime").click(function () {
                $("#cdCreatedTime").hide();
            });

            $("#cbAuthor").click(function () {
                if ($("#cdAuthor").is(":hidden")) {
                    $("#cdAuthor").fadeIn("normal");
                }
            });
            $("#cdAuthor").click(function () {
                $("#cdAuthor").hide();
            });

            $("#cbCategory").click(function () {
                if ($("#cdCategory").is(":hidden")) {
                    $("#cdCategory").fadeIn("normal");
                }
            });
            $("#cdCategory").click(function () {
                $("#cdCategory").hide();
            });

            $("#cbCountry").click(function () {
                if ($("#cdCountry").is(":hidden")) {
                    $("#cdCountry").fadeIn("normal");
                }
            });
            $("#cdCountry").click(function () {
                $("#cdCountry").hide();
            });

            $("#cbCity").click(function () {
                if ($("#cdCity").is(":hidden")) {
                    $("#cdCity").fadeIn("normal");
                }
            });
            $("#cdCity").click(function () {
                $("#cdCity").hide();
            });

            $("#advancedsearch").submit(function () {
                $("#sImgName").val(!$("#cdImgName").is(":hidden"));
                $("#sCreatedTime").val(!$("#cdCreatedTime").is(":hidden"));
                $("#sAuthor").val(!$("#cdAuthor").is(":hidden"));
                $("#sCategory").val(!$("#cdCategory").is(":hidden"));
                $("#sCountry").val(!$("#cdCountry").is(":hidden"));
                $("#sCity").val(!$("#cdCity").is(":hidden"));
            });
        });

//        $("#ExImg").mouseover(function () {
//            var temp = "#dtSlide" + "ExImg";
//            $("#dtSlideExImg").show("slow");
//        });
//        $("#ExImg").mouseout(function () {
//            var temp = "#dtSlide" + "ExImg";
//            $(temp).hide("slow");
//        });

//                function SlideHover(text) {
//                    $("#ExImg").mouseover(function () {
//                        var temp = "#dtSlide" + text;
//                        $(temp).show("slow");
//                    });
//                    $("#ExImg").mouseout(function () {
//                        var temp = "#dtSlide" + text;
//                        $(temp).hide("slow");
//                    });
//                }

//                function test() {
//                    window.alert("ds");
//                }

    </script>

</asp:Content>
